package com.lhb.boyixue.user.controller;

import com.lhb.boyixue.base.UnifyResponseObject;
import com.lhb.boyixue.user.model.Case;
import com.lhb.boyixue.user.model.Paper;
import com.lhb.boyixue.user.model.PracticeExercisesModel;
import com.lhb.boyixue.user.model.Question;
import com.lhb.boyixue.user.service.ExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 86131
 * @version 1.0
 * @description
 * @date 2025/6/25 下午11:23
 */
@RestController
@RequestMapping("/exam")
public class ExamController {
    @Autowired
    ExamService examService;
    @GetMapping("/comprehensive")
    public UnifyResponseObject<List<Question>> comprehensive(String title, String year) {
           List<Question> questionList=  examService.comprehensive(title,year);
         return UnifyResponseObject.success(questionList);
    }
    @GetMapping("/case")
    public UnifyResponseObject<List<Case>> caseAnalysis(String title, String year) {
        List<Case> caseList =  examService.caseAnalysis(title,year);
        return UnifyResponseObject.success(caseList);
    }
    @GetMapping("/paper")
    public UnifyResponseObject<List<Paper>> paper(String title, String year) {
        List<Paper> paperList =  examService.paper(title,year);
        return UnifyResponseObject.success(paperList);
    }

    @GetMapping("/practise")
    public UnifyResponseObject<List<Question>> practise() {
        List<Question> questionList=  examService.practise();
        return UnifyResponseObject.success(questionList);
    }

    @GetMapping("/practice_exercises")
    public  UnifyResponseObject<List<PracticeExercisesModel>> practiceExercises(String category) {
        List<PracticeExercisesModel> practiceExercisesModelList= examService.practiceExercises(category);
        return UnifyResponseObject.success(practiceExercisesModelList);
    }

}
